package com.zcx.qshop.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import com.zcx.qshop.R;

/**
 * Created by Administrator on 2015/9/10 0010.
 */
public abstract class PicurlDialog extends QSDialog {

    public PicurlDialog(Context context) {

        super(context);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.dialog_picurl);

        getWindow().setGravity(Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL);

        View.OnClickListener onClickListener = new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                switch(v.getId()){

                    case R.id.dialog_picurl_camera:

                        onCamera();

                        break;

                    case R.id.dialog_picurl_album:

                        onAlbum();

                        break;

                }

                dismiss();

            }

        };

        findViewById(R.id.dialog_picurl_camera).setOnClickListener(onClickListener);

        findViewById(R.id.dialog_picurl_album).setOnClickListener(onClickListener);

        findViewById(R.id.dialog_picurl_close).setOnClickListener(onClickListener);

    }

    protected abstract void onCamera();

    protected abstract void onAlbum();

}
